package com.aaa.service.impl;

import com.aaa.dao.Fund_Management_Mapper;
import com.aaa.pojo.Change;
import com.aaa.pojo.Fund_Management;
import com.aaa.pojo.Term_Financial;
import com.aaa.service.Fund_Management_Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class Fund_Management_ServiceImpl implements Fund_Management_Service {
    @Autowired
    private Fund_Management_Mapper mapper;
    @Override
    public PageInfo<Fund_Management> getAllUsersByPage(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);//这行是重点，表示从pageNum页开始，每页pageSize条数据
        List<Fund_Management> list = mapper.selectAll();
        PageInfo<Fund_Management> pageInfo = new PageInfo<Fund_Management>(list);
        return pageInfo;
    }

    @Override
    public List<Fund_Management> selectAll() {
        return mapper.selectAll();
    }

    @Override
    public boolean insert(Fund_Management management) {
        return mapper.insert(management);
    }

    @Override
    public boolean update(Fund_Management management) {
        return mapper.update(management);
    }

    @Override
    public boolean delete(Integer f_id) {
        return mapper.delete(f_id);
    }

    @Override
    public Fund_Management selectById(Integer f_id) {
        return mapper.selectById(f_id);
    }
}
